import home from './tabbarcomponent/homecont.vue'
import member from './tabbarcomponent/membercont.vue'
import shopcar from './tabbarcomponent/shopcarcont.vue'
import search from './tabbarcomponent/searchcont.vue'

import newslist from './homecomponents/newslistcont.vue'
import newsinfo from './homecomponents/newslistinfo.vue'
import VueRouter from 'vue-router'
import photolist from './homecomponents/photocont/photolist.vue'
import photoinfo from './homecomponents/photocont/photoinfo.vue'
import goodlist from './homecomponents/goodcont/goodlist.vue'

import goodinfo from './homecomponents/goodcont/goodinfo.vue'

import imgtext from './homecomponents/goodcont/goodinfosub/imgintroduce.vue'
import shopcomment from './homecomponents/goodcont/goodinfosub/shopcomment.vue'

var router=new VueRouter({
    routes:[
        {path:'/',redirect:"/home"},
       {path:"/home",component:home},
       {path:"/member",component:member},
       {path:"/shopcar",component:shopcar},
       {path:"/search",component:search},
       {path:"/home/newslist",component:newslist},
    //用来匹配id来自于newlistcont.vue新闻列表中的每个列表的id
       {path:"/home/newsinfo/:id",component:newsinfo},
       {path:'/home/photolist',component:photolist},
       {path:'/home/photoinfo/:id',component:photoinfo},
       {path:'/home/goodlist',component:goodlist},
      //  component出现问题多了个s,导致页面出现问题。
       {path:"/home/goodinfo/:id",component:goodinfo,name:"user"},
       {path:"home/goodinfo/imgtext/:id",component:imgtext,name:"imgtext"},
       {path:"home/goodinfo/shopcomment/:id",component:shopcomment,name:"shopcomment"}
    ],
    linkActiveClass:"mui-active"
})

export default router 